package com.example.demo.service;

import com.example.demo.entity.Articleinfo;
import com.example.demo.entity.Userinfo;
import com.example.demo.mapper.ArticleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
@Service
public class ArticleService {

    @Resource
    private ArticleMapper mapper;

    // 查询用户信息和用户博客数量
    public Integer getArtCountByUid(Integer uid) {
        return mapper.getArtCountByUid(uid);
    }

    // 根据用户 id 查询用户所有博客
    public List<Articleinfo> getMyList(Integer uid) {
        return mapper.getMyList(uid);
    }

    // 根据博客 id 逻辑删除博客信息
    public Integer del(Integer id, Integer uid) {
        return mapper.del(id, uid);
    }
}
